-- GENERATED SPELL FOR [Leviathan] --


function spell0_22884(pUnit, Event) --@Debilitating Spray,n/a--
pUnit:FullCastSpellOnTarget(40079,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22884', 12500, 1)
end

function spell1_22884(pUnit, Event) --@Poison Spit,n/a--
pUnit:FullCastSpellOnTarget(40078,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22884', 12500, 1)
end

function spell2_22884(pUnit, Event) --@Tail Sweep,n/a--
pUnit:FullCastSpellOnTarget(40077,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22884', 612, 1)
end

function Sorts_22884(pUnit, Event)
local choix_sorts_22884 = math.random(0, 2)
if choix_sorts_22884 == 0 then
pUnit:RegisterEvent('spell0_22884', 1, 1)
end
if choix_sorts_22884 == 1 then
pUnit:RegisterEvent('spell1_22884', 1, 1)
end
if choix_sorts_22884 == 2 then
pUnit:RegisterEvent('spell2_22884', 1, 1)
end
end

function mob22884_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_22884', math.random(1500, 3000), 1)
end

function mob22884_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22884_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22884_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(22884, 1, 'mob22884_Action')
RegisterUnitEvent(22884, 2, 'mob22884_Leave')
RegisterUnitEvent(22884, 3, 'mob22884_Kill')
RegisterUnitEvent(22884, 4, 'mob22884_Die')
